package com.welsy.iter.vo.iter
{
	import mx.events.DragEvent;
	import mx.containers.Canvas;	
	import mx.events.IndexChangedEvent;
	import com.welsy.iter.view.itercomponents.IterElementView;
	import com.welsy.iter.business.IterElementType;
	
	public class IterElementFactory
	{		
        public static function getIterElementByXml(CourseNode:XML):IterElementVO
        {
        	var myIterElementVO:IterElementVO = new IterElementVO
        	
        	myIterElementVO.type = "0";
        	myIterElementVO.title = CourseNode.@title;        	
        	myIterElementVO.Description = CourseNode.@description;
        	myIterElementVO.CourseId = CourseNode.@courseId
       
			return myIterElementVO;
        } 
        
        public static function getIterElementByEvent(event:DragEvent):IterElementVO
        {
        	var myIterElementVO:IterElementVO = new IterElementVO
        	
        	var sourceObj:Object = Object(event.dragInitiator);	            	
        	var Type:String = String(IterElementType.iterElementCode[sourceObj.id]);
        	
        	myIterElementVO.type = Type
        	myIterElementVO.title = IterElementType.IterElementLabel[Type]

			return myIterElementVO;
        }          		
	}
}